Session Storage
Characteristic
Short description
The session storage is a database where PlanToursRequests can be stored.
Use
The stored requests in the session storage offer the possibility to use ChangeToursRequests and ToursInExecutionRequests.
Detailed Consideration
Per default, PTV xServer provides an H2 database to store different states of a tour plan, the so-called session storage.
Stored objects
The session storage stores PlanToursRequest objects that are mapped to unique stored request IDs. The request IDs can be used in ChangeToursRequests to manipulate the existing tour plans. A ChangeToursRequest creates a new PlanToursRequest object and stores it in the session storage using a newly generated request ID. The requested changes are integrated into the input plan of the new PlanToursRequest. The original PlanToursRequest remains unchanged.
A stored request can be used in a ToursInExecutionRequest to calculate the estimated times of arrival based on the current positions of its vehicles The term vehicle describes what is being routed or planned for. Vehicles are used in route calculation, distance matrix calculation and effectively also in tour planning. In route calculation, vehicle properties like overall size, weight and speed are in focus. In tour planning, it is vehicle properties like capacity and availability. Commonly a vehicle is motorized, like a truck - including its trailer or a car. However also a bike or even a pedestrian are included in this definition.. A ToursInExecutionRequest does not store a new request in the session storage, but it attaches routing A route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. information to the original request. This routing information cannot explicitly be accessed via the PTV xServer API, but it is used internally to speed up the response time of subsequent ToursInExecutionRequests. Newly generated requests do not have any routing information attached.
A DataNotAvailableFault is thrown if a referenced stored request ID is invalid or if the corresponding request was deleted.
Lifetime of stored requests
Requests in the session storage cannot be deleted via the PTV xServer API. However, there are two general parameters in the PTV xServer configuration file to limit the life span of the stored requests. These parameters are core.session.retentionTime
and core.session.cleanupInterval
, see Server Configuration.
Each stored request has a time stamp containing its creation time. A ToursInExecutionRequest resets the time stamp of the corresponding stored request to the current server time. A cleanup task is started once after every cleanup interval and deletes all requests whose time stamps are older than the retention time.
Good to know
PTV xServer Database
The PTV xServer can be configured to use other databases apart from H2 if there is a jdbc driver for the desired database.
Related Topics
Technical Concept | Change Tours |
Integration Sample | Changing Stored Tours |
Administrator's Guide | Database Configuration |